<!--
 * @Description: 
 * @Autor: ZachGmy
 * @Date: 2021-06-21 10:05:45
 * @LastEditors: ZachGmy
 * @LastEditTime: 2021-06-21 10:40:36
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    div {
      width: 100px;
      height: 100px;
    }

    .div1 {
      background-color: red;
    }

    .div2 {
      background-color: yellow;
      /* 相对定位 */
      position: relative;
      /* 距离左边有一个20px的距离 */
      left: 20px;
      top: 20px;
      margin: 100px;
    }

    .div3 {
      background-color: blue;
    }
  </style>
</head>

<body>
  <div class="div1">1</div>
  <div class="div2">2</div>
  <div class="div3">3</div>
</body>

</html>